﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security;
using System.Web;
using System.Web.Mvc;
using Defero.Core;
using Defero.Core.DomainObjects;
using Defero.Core.Entities;

namespace Defero.Web.Controllers
{
    /// <summary>
    /// Define toda la funcionalidad basica de un controlador, para la actual aplicación
    /// </summary>
    public abstract class DeferoController : Controller
    {
        /// <summary>
        /// Usuario en sesión.
        /// </summary>
        [Microsoft.Practices.Unity.Dependency]
        public new IUser User { get; private set; }
        /// <summary>
        /// Constructor default.
        /// </summary>
        public DeferoController() {}
        /// <summary>
        /// Inicia sesión.
        /// </summary>
        public bool TryLogIn(string userName, string password) {
            //IUser user;
            //return AuthenticationManager.TryLogIn(userName, string password, out user);
            return true;
        }
        /// <summary>
        /// Termina sesión.
        /// </summary>
        public void LogOff() {
            //AuthenticationManager.LogOff(User);
        }
    }
}
